/**
 * Project litesql++
 */


#ifndef _SQLITETABLE_H
#define _SQLITETABLE_H

#include <vector>
#include <memory>
#include "sqlite_record.h"

using std::vector;
using std::shared_ptr;

class SQLiteTable {
public: 

    SQLiteTable();

    ~SQLiteTable();

    const string& table_name() const;
    
    /**
     * @param table_name
     */
    void set_table_name(const string& table_name);
    
    /**
     * @param column_name
     * @param flag including data type and constraint as string
     */
    void AddColumn(const string& column_name, const string& flag);
    
    const string ColumnsAsSQLCreateString() const;

    void AddRecord(shared_ptr<SQLiteRecord> record);

    const shared_ptr<SQLiteRecord> GetNextRecord();

    void ResetRecords();
    
    const int GetRecordCount();
    
private:
    string table_name_;
    int records_pos_;
    vector<string> columns_;
    vector<shared_ptr<SQLiteRecord>> records_;
};

#endif //_SQLITETABLE_H
